<%--
  Created by IntelliJ IDEA.
  User: sxing
  Date: 14-10-4
  Time: 上午10:40
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    %{--<meta name="layout" content="manage"/>--}%
    <title></title>
    <style type="text/css" rel="stylesheet" >
    *{ margin: 0; padding: 0;}
    a{text-decoration:none; display: inline-block; cursor:pointer;}
    .f_l{ float:left;}
    .f_r{ float:right;}
    .clear{clear:both;}
    ul li, ol li, li{ list-style-type:none;}
    /*------登录------*/
    .Balogbg{ width:400px; height: 300px; position: absolute; left: 50%; top:0; margin-left: -200px;}
    .Balog_blk{ margin: 20% auto 0; width:400px; height: 300px; border:1px solid #048f59; background: #efffe7;
        background: rgba(255, 255, 255, 0.90);
        /* -moz-box-shadow: 0 0 0 2px rgba(56, 41, 32, 0.25);
         -webkit-box-shadow: 0 0 0 2px rgba(56, 41, 32, 0.25);
         box-shadow: 0 0 0 2px rgba(56, 41, 32, 0.25);*/
        border-radius: 0.9em;
        -webkit-border-radius:0.9em;
        -moz-border-radius:0.9em;
        -o-border-radius:0.9em;
    }
    .login-head { padding: 1em 0; background:#07b973; position:relative;
        border-top-left-radius: 0.9em;
        border-top-right-radius: 0.9em;
        -webkit-border-top-left-radius:0.9em;
        -webkit-border-top-right-radius:0.9em;
        -moz-border-top-left-radius:0.9em;
        -moz-border-top-right-radius:0.9em;
        -o-border-top-left-radius:0.9em;
        -o-border-top-right-radius:0.9em;}
    .login-head h1 { color: #fff; font-size: 1.5em;  text-align: left; margin: 0 23px;}
    .Balog_con { padding: 3em 2em;}
    .Balog_con li{ line-height: 32px; list-style:none; margin-bottom:20px; overflow: hidden;}
    .Balog_con label{ width:80px; height: 32px; text-align: right; line-height: 32px; padding-right:20px;}
    .Balog_con span{ width:235px; height: 32px; line-height: 32px;}
    .Balog_con span input{ border: 1px solid #ddd;  background:#F0EEF0; padding-left: 3px;  height: 26px; width:150px;
        border-radius: 0.3em;
        -webkit-border-radius:0.3em;
        -moz-border-radius:0.3em;
        -o-border-radius:0.3em;
    }
    .Balog_submit{ padding: 5px 0; margin-top: 30px;}
    .Balog_sub_id{ width:80px; line-height: 30px;border:1px solid #009900; margin-left: 135px;font-size: 16px; background:#07b973; font-family:"Microsoft YaHei";
        color: #fff;
        border-radius: 0.2em;
        -webkit-border-radius:0.2em;
        -moz-border-radius:0.2em;
        -o-border-radius:0.2em;
    }
    .Balog_sub_id:hover{border:1px solid #07b973; color: #fff; background:#26da93; cursor: pointer;}

    .Balog_submit h4{ text-align: center;  margin-top: 15px;}
    .Balog_submit h4 a{ font-size: 16px;  color: #444;  font-weight: 400;  font-family: 'Droid Sans', sans-serif;  margin-top: 15px;  margin-left: 21px;}
    .Balog_submit h4 a:hover{ color:#07b973;}
    /*------/登录------*/




    </style>
    <script type="text/javascript" src="${resource(dir:'/assets/js',file:'jquery-1.11.0.js')}"></script>
    <script>
        window.onload=function()
        {
            var oUserName=document.getElementById('userName');
            var oPassword=document.getElementById('password');
            var oLogin=document.getElementById('submit_id');

            oUserName.onkeydown=oPassword.onkeydown=function(ev)
            {
                var oEvent=ev||event;
                if(oEvent.keyCode==13)//13就是回车健
                {
                    var txtName = $('#userName').val();
                    var txtPwd = $('#password').val();
                    $.ajax({
                        url: "loginCheck", //用于登录验证的服务器端请求地址
                        type: 'POST',
                        data:{userName:txtName, password:txtPwd},
                        dataType: 'json',
                        timeout: 1000,
                        error: function(){
                            alert('登录失败');
                        },
                        success: function(result){
                            if(result.status == 1){
                                window.location.href='index';
                            }else{
                                alert(result.message)
                            }

                        }
                    });
                }
            };

            oLogin.onclick=function()
            {
                var txtName = $('#userName').val();
                var txtPwd = $('#password').val();
                $.ajax({
                    url: "loginCheck", //用于登录验证的服务器端请求地址
                    type: 'POST',
                    data:{userName:txtName, password:txtPwd},
                    dataType: 'json',
                    timeout: 1000,
                    error: function(){
                        alert('登录失败');
                    },
                    success: function(result){
                        if(result.status == 1){
                            window.location.href='index';
                        }else{
                            alert(result.message)
                        }

                    }
                });
            };


        };
    </script>
</head>
<body style=" background:#a2d962 url(http://www.xwcms.net/webAnnexImages/fileAnnex/20131015/35819/images/login_03.gif) repeat-x 0 0;">
<div class="Balogbg">
    <div class="Balog_blk">
        <div class="login-head">
            <h1>登录</h1>
            <div class="alert-close"> </div>
        </div>
        <form>
            <div class="Balog_con">
                <li>
                    <label class="f_l">帐 号：</label>
                    <span class="f_l"><input type="text" class="text" id="userName" value="" >suk100</span>
                </li>
                <div class="clear"> </div>
                <li>
                    <label class="f_l">密 码：</label>
                    <span class="f_l"><input type="password" value="" id="password" >suk100</span>
                </li>
                <div class="clear"> </div>

                <div class="Balog_submit">
                    <input type="button" id="submit_id" class="Balog_sub_id" value=" 登 录 ">
                    <div class="clear">  </div>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>

%{--onclick="login()"--}%
%{--<script>
    function login () {
        var txtName = $('#userName').val();
        var txtPwd = $('#password').val();
        $.ajax({
            url: "loginCheck", //用于登录验证的服务器端请求地址
            type: 'POST',
            data:{userName:txtName, password:txtPwd},
            dataType: 'json',
            timeout: 1000,
            error: function(){
                alert('登录失败');
            },
            success: function(result){
                if(result.status == 1){
                    window.location.href='index';
                }else{
                    alert(result.message)
                }

            }
        });
    }
</script>--}%
